package com.yesemate.splayer.helper

import android.graphics.Bitmap
import android.os.Environment
import android.text.TextUtils
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.yesemate.splayer.Splayer
import com.yesemate.splayer.util.md5

class IFFmpegHelper(override var filePath:String,
                    override var onGetFrameBitmapCallback: OnGetFrameBitmapCallback?): IAvFrameHelper,Runnable {
    private val mainKey = md5(filePath)
    private var diskCache:DiskCacheAssist? = null
    private var childThread:Thread? = null

    private var kzgPlayer:Splayer? = null
    fun setFFPlayer(kzgPlayer:Splayer){
        this.kzgPlayer=kzgPlayer;
    }
    override var lastBitMap: Bitmap?
        get() = TODO("Not yet implemented")
        set(value) {}
    override var decodeFrameListener: IAvFrameHelper.DecodeFrameListener?
        get() = TODO("Not yet implemented")
        set(value) {}
    override var isSeekBack: Boolean
        get() = TODO("Not yet implemented")
        set(value) {}
    override var isScrolling: Boolean
        get() = TODO("Not yet implemented")
        set(value) {}
    override var isPause: Boolean
        get() = TODO("Not yet implemented")
        set(value) {}
    override var itemFrameForTime: Long
        get() = TODO("Not yet implemented")
        set(value) {}

    override fun init() {
        diskCache = DiskCacheAssist(
            TextUtils.concat(
            Environment.getExternalStorageDirectory().path,
            "/frameCache/", mainKey).toString(), 1, 1, 121)

        childThread = Thread(this)
        childThread!!.start()
    }

    override fun loadAvFrame(view: RecyclerView.ViewHolder, timeMs: Long) {
        TODO("Not yet implemented")
    }

    override fun loadAvFrame(view: ImageView, timeMs: Long) {
        TODO("Not yet implemented")
    }

    override fun addAvFrame(view: ImageView) {
        TODO("Not yet implemented")
    }

    override fun removeAvFrameTag(view: ImageView) {
        TODO("Not yet implemented")
    }

    override fun removeAvFrame() {
        TODO("Not yet implemented")
    }

    override fun release() {
        TODO("Not yet implemented")
    }

    override fun seek() {
        TODO("Not yet implemented")
    }

    override fun pause() {
        TODO("Not yet implemented")
    }

    override fun run() {

    }
}